<?
require("config.php");

$location_status .= "| Delete";
$show_backnav = "ban_menu";
$menuname = NULL;
$menutarget = NULL;

if (NULL!=$action){

	$Query = "DELETE FROM $table WHERE id=$id";
	myQuery($Query);

   header("location:" . $rela_path . "share/msg.php?v=73");

   exit();

}else{

  if (!checkRecord($table,$id)){

	header("location:" . $rela_path . "share/msg.php?v=9002");

	exit();
  
  }

}


$Query = "SELECT 
code,
name, 
file,
product
FROM $table WHERE id=$id LIMIT 1";

$r=myQuery($Query);

$Code=$r[0][0];
$name=$r[0][1];
$Picture=$r[0][2];
$product_str=$r[0][3];

$Query="select id,code,name from pro_basic where publish='1' order by id desc;";
$r=myQuery($Query);
$product='';
for ($i=0 ; $i<count($r) ; $i++) {
	if (substr_count($product_str,'|'.$r[$i][0].'|')) $product.=$r[$i][1].'-'.$r[$i][2].'<br />';
}


require($rela_path . "inc/header.php");

?>
<form action="" method="post" enctype="multipart/form-data" name="form1">
<input name="action" type="hidden" value="delete">
<input name="id" type="hidden" value="<?print($id)?>">




<table width="95%" border="0" align="center">
  <tr> 
      <td valign="top"> <p><br>
          <br>
          Are you sure to delete this Manual ? 
          <input type="submit" class="button" name="Submit2" value="  Yes  ">
          <input type="button" class="button" name="Submit3" value="  No  " onClick="Redirect('ban_menu.php',1);">
          <br>
          <br>
        <table border="0" cellspacing="5" cellpadding="1">
          <tr> 
            <td class="tdheader">Code :</td>
            <td><?print($Code)?></td>
          </tr>
          <tr> 
            <td class="tdheader">Name : </td>
            <td><?print($name)?></td>
          </tr>
          <tr>
            <td class="tdheader">File :</td>
            <td><a href="<?=$rela_path.$PIC_DIR."pro_firmware/".$Picture?>" target="_blank"><?=$Picture?></a></td>
          </tr>
		  <tr>
            <td class="tdheader">Products :</td>
			<td><?=$product?></td>
		  </tr>
        </table>
        <p>
        <p> 
        <p> </td>

  </tr>
</table>
<br>
<br>
<br>


</form>
<?
require($rela_path . "inc/footer.php");
?>
